﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="MyDrafts.aspx.cs" Inherits="BEGDC.CC.Web.EZVisit.View.MyDrafts" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ Register TagPrefix="uc1" TagName="PageNavigation" Src="~/UserControls/PageNavigation.ascx" %>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
    <title>Alcatel-Lucent Customer Care</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <link href="../../css/global.css" type="text/css" rel="stylesheet" />
    <link href="../../css/ezform.css" rel="stylesheet" type="text/css" />

    <script language="JavaScript" type="text/javascript" src="../../js/jquery-1.4.4.min.js"></script>

</head>
<body class="purple-bg">
    <uc1:PageNavigation ID="PageNavigation1" runat="server"></uc1:PageNavigation>
    <div class="tab-box purplebg_dark">
        <ul class="tab-pos">
            <li><span class="tab-active">Draft 草稿</span></li>
        </ul>
    </div>
    <form id="Form1" method="post" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    <div class="fw formbox txt_align_rgt">
        <asp:Button ID="btnNewRequest" runat="server" Text="New Request (添加申请)" CssClass="btn" OnClick="btnNewRequest_Click" />
        <asp:Button ID="btnExport" runat="server" Text="Export to Excel (导出)" CssClass="btn" OnClick="btnExport_Click" />
    </div>
    <asp:UpdatePanel ID="uplBody" runat="server" UpdateMode="Conditional">
        <ContentTemplate>
            <asp:DataGrid ID="dgDrafts" ShowHeader="True" AutoGenerateColumns="False" GridLines="both" runat="server" PageSize="10" AllowPaging="True"
                PagerStyle-Visible="False" AllowSorting="True" CssClass="tablestyle" OnItemCommand="dgDrafts_ItemCommand" OnSortCommand="dgDrafts_SortCommand"
                OnItemDataBound="dgDrafts_ItemDataBound">
                <ItemStyle CssClass="tbody trwhitebg" />
                <AlternatingItemStyle CssClass="tbody trpurplebg" />
                <HeaderStyle CssClass="thead" />
                <Columns>
                    <asp:BoundColumn Visible="False" DataField="AppID" />
                    <asp:TemplateColumn HeaderText="Application No.<br/>申请单号" SortExpression="AppNo">
                        <ItemTemplate>
                            <a href="#" title="Open Application(打开申请单)" onclick="return openWindow('../ezvrequest.aspx?ID=<%# DataBinder.Eval(Container.DataItem,"AppID") %>')">
                                <%# DataBinder.Eval(Container.DataItem,"AppNo") %></a>
                        </ItemTemplate>
                    </asp:TemplateColumn>
                    <asp:BoundColumn DataField="RequesterNameEN" HeaderText="Applicant<br/>申请人" SortExpression="RequesterNameEN" Visible="false" />
                    <asp:BoundColumn DataField="Department" HeaderText="CAT/Branch<br/>总部/分公司" SortExpression="Department" />
                    <asp:BoundColumn DataField="Company" HeaderText="Customer Company<br/>客户公司" SortExpression="Company" />
                    <asp:BoundColumn DataField="Venue" HeaderText="Venue <br/>地点" SortExpression="Venue">
                        <HeaderStyle Width="30%" />
                        <ItemStyle Width="30%" />
                    </asp:BoundColumn>
                    <asp:BoundColumn DataField="RequestedDateFrom" HeaderText="Begin Date<br/>开始时间" SortExpression="RequestedDateFrom" DataFormatString="{0:M/d/yyyy}" />
                    <asp:BoundColumn DataField="RequestedDateTo" HeaderText="End Date<br/>结束时间" SortExpression="RequestedDateTo" DataFormatString="{0:M/d/yyyy}" />
                    <asp:BoundColumn DataField="CreateAt" HeaderText="Created Date<br/>创建日期" SortExpression="CreateAt" DataFormatString="{0:M/d/yyyy}" />
                    <asp:TemplateColumn HeaderText="Action<br/>操作" ItemStyle-HorizontalAlign="Center">
                        <ItemTemplate>
                            <img src="../../images/COMEDIT.GIF" alt="Open (打开)" onclick="return openWindow('../ezvrequest.aspx?ID=<%# DataBinder.Eval(Container.DataItem,"AppID") %>')"
                                onmouseover="this.style.cursor='hand'" title="Open (打开)" />&nbsp;&nbsp;
                            <asp:ImageButton ImageUrl="~/images/icon_Delete.gif" ID="btnDelete" ToolTip="Delete (删除)" CommandName="Delete" runat="server" />
                        </ItemTemplate>
                    </asp:TemplateColumn>
                </Columns>
            </asp:DataGrid>
            <div class="fw padding5 txt_align_rgt">
                <span class="float_lft">Total Records:
                    <asp:Label ID="lblRecordCount" runat="server" />
                    &nbsp;&nbsp;&nbsp;<img src="../../images/book_open.gif" alt="Page (页码)" title="Page (页码)" />&nbsp;Page:
                    <asp:Label ID="lblCurrentPageIndex" runat="server" />&nbsp;/&nbsp;
                    <asp:Label ID="lblPageCount" runat="server" />
                </span><span>
                    <asp:ImageButton ID="btnPageFirst" runat="server" ImageUrl="~/images/pg_first_inact.gif" ImageAlign="AbsMiddle" ToolTip="First Page (第一页)"
                        OnClick="btnPageFirst_Click" />
                    &nbsp;
                    <asp:ImageButton ID="btnPagePrev" runat="server" ImageUrl="~/images/pg_pre_inact.gif" ImageAlign="AbsMiddle" ToolTip="Prev Page (上一页)"
                        OnClick="btnPagePrev_Click" />
                    &nbsp;
                    <asp:ImageButton ID="btnPageNext" runat="server" ImageUrl="~/images/pg_next.gif" ImageAlign="absmiddle" ToolTip="Next Page (下一页)"
                        OnClick="btnPageNext_Click" />
                    &nbsp;
                    <asp:ImageButton ID="btnPageLast" runat="server" ImageUrl="~/images/pg_last.gif" ImageAlign="absmiddle" ToolTip="Last Page (最后一页)"
                        OnClick="btnPageLast_Click" />
                    &nbsp; Go To Page:
                    <asp:TextBox ID="txtPage" runat="server" onmouseover="this.className='txtboxover width40';" onmouseout="this.className='txtbox width40';"
                        CssClass="txtbox width40" />
                    <asp:ImageButton ID="btnGotoPage" runat="server" ImageUrl="~/images/book_open.gif" ToolTip="Goto Page (转到)" OnClick="btnGotoPage_Click" /></span>
            </div>
            <asp:Button ID="btnReload" OnClick="btnReload_Click" runat="server" />
        </ContentTemplate>
        <Triggers>
            <asp:AsyncPostBackTrigger ControlID="btnReload" EventName="Click" />
            <asp:AsyncPostBackTrigger ControlID="dgDrafts" EventName="SortCommand" />
            <asp:AsyncPostBackTrigger ControlID="btnGotoPage" EventName="Click" />
            <asp:AsyncPostBackTrigger ControlID="btnPageFirst" EventName="Click" />
            <asp:AsyncPostBackTrigger ControlID="btnPageLast" EventName="Click" />
            <asp:AsyncPostBackTrigger ControlID="btnPagePrev" EventName="Click" />
            <asp:AsyncPostBackTrigger ControlID="btnPageNext" EventName="Click" />
        </Triggers>
    </asp:UpdatePanel>
    </form>

    <script type="text/javascript">
        Sys.WebForms.PageRequestManager.getInstance().add_pageLoaded(function(sender, e) {
            $('#<%= this.dgDrafts.ClientID %> .trwhitebg').mouseover(function() {
                $(this).removeClass('trwhitebg');
                $(this).addClass('trhover');
            }).mouseout(function() {
                $(this).removeClass('trhover');
                $(this).addClass('trwhitebg')
            });
            $('#<%= this.dgDrafts.ClientID %> .trpurplebg').mouseover(function() {
                $(this).removeClass('trpurplebg');
                $(this).addClass('trhover');
            }).mouseout(function() {
                $(this).removeClass('trhover');
                $(this).addClass('trpurplebg');
            })
        });

        function openWindow(url) {
            var w = screen.availWidth - 100;
            var h = screen.availHeight - 100;
            var top = 50;
            var left = 40;
            window.open(url, '_blank', 'scrollbars=yes,width=' + w + ',height=' + h + ',top=' + top + ',left=' + left + ',resizable=yes');
            return false;
        }

        function RefreshGrid(target) {
            $('#<%= btnReload.ClientID %>').click();
        }
    </script>

</body>
</html>